library(MicEco)
library("ggplot2")
library("phyloseq")
setwd("~/nicolagk@hawaii.edu - Google Drive/My Drive/Bamboo_mesos/Bamboo_mesos/16S_bacteria/01.process_asvs/control_checks")
##ps object with all the steps except the trimming one
ps.clean.notrim <- readRDS("../bamboomesos_ps.lulu.clean.notrim.decontam.rds")
##ps object with the trimming
ps.clean.trim <- readRDS("../bamboomesos_ps.lulu.clean.decontam.rds")
##seeing if raw reads line up with expectations
samdf.clean.trim <- ps.clean.trim@sam_data
ggplot(samdf.clean.trim,aes(x=Short_label,y=lib_size_clean,color=Microbe_treatment))+
geom_point()+
facet_wrap(~Microbe_treatment,scales="free_x")
samdf.clean.trim.no20 <- subset(samdf.clean.trim,Exp_day!=20)
ggplot(samdf.clean.trim.no20,aes(x=Mesocosm_treatment,y=Raw_reads,color=Microbe_treatment))+
geom_boxplot()
ps.stocks1 <- subset_samples(ps.clean.trim,Sample_type=="Microbe Stock")
ps.stocks <- prune_taxa(taxa_sums(ps.stocks1)!=0,ps.stocks1)
ps.stocks
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 96 taxa and 3 samples ]
## sample_data() Sample Data: [ 3 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 96 taxa by 10 taxonomic ranks ]
ps_venn(ps.stocks,group="Microbe_treatment",quantities=TRUE,main="ASVs per microbial stock",labels=c("LAB","ENV","MOS"),fills = list(fill = c("#7D0112", "#84D1B5","#C6A947"), alpha = 0.5))
ps_venn(ps.stocks,group="Microbe_treatment",plot=F)
## $`E. coli`
## [1] "ASV0001" "ASV0030"
##
## $`Env. microbes`
## [1] "ASV0004" "ASV0007" "ASV0008" "ASV0009" "ASV0010" "ASV0012" "ASV0016"
## [8] "ASV0017" "ASV0022" "ASV0025" "ASV0051" "ASV0059" "ASV0063" "ASV0066"
## [15] "ASV0069" "ASV0072" "ASV0093" "ASV0095" "ASV0102" "ASV0105" "ASV0111"
## [22] "ASV0116" "ASV0117" "ASV0123" "ASV0146" "ASV0155" "ASV0162" "ASV0167"
## [29] "ASV0175" "ASV0179" "ASV0180" "ASV0218" "ASV0238" "ASV0239" "ASV0277"
## [36] "ASV0278" "ASV0281" "ASV0282" "ASV0286" "ASV0311" "ASV0322" "ASV0333"
## [43] "ASV0338" "ASV0368" "ASV0383" "ASV0386" "ASV0398" "ASV0412" "ASV0432"
## [50] "ASV0433" "ASV0436" "ASV0466" "ASV0474" "ASV0521" "ASV0527" "ASV0528"
## [57] "ASV0534" "ASV0545" "ASV0578" "ASV0580" "ASV0583" "ASV0613" "ASV0634"
## [64] "ASV0665" "ASV0752" "ASV0786" "ASV0868" "ASV0938"
##
## $`Mosquito microbes`
## [1] "ASV0003" "ASV0027" "ASV0045" "ASV0058" "ASV0100" "ASV0136" "ASV0145"
## [8] "ASV0206" "ASV0312" "ASV0324" "ASV0344" "ASV0355" "ASV0606" "ASV0648"
## [15] "ASV0672" "ASV0676" "ASV0685" "ASV0699" "ASV0768" "ASV0870" "ASV0989"
## [22] "ASV1146"
##
## $`Env. microbes__Mosquito microbes`
## [1] "ASV0006" "ASV0053" "ASV0149" "ASV0525"
#grid.draw(venn.stocks)
ps.stocks.notrim1 <- subset_samples(ps.clean.notrim,Sample_type=="Microbe Stock")
ps.stocks.notrim <- prune_taxa(taxa_sums(ps.stocks.notrim1)!=0,ps.stocks.notrim1)
ps.stocks.notrim
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 200 taxa and 3 samples ]
## sample_data() Sample Data: [ 3 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 200 taxa by 10 taxonomic ranks ]
ps_venn(ps.stocks.notrim,group="Microbe_treatment",quantities=TRUE,main="ASVs per microbial stock",labels=c("LAB","ENV","MOS"),fills = list(fill = c("#7D0112", "#84D1B5","#C6A947"), alpha = 0.5))
#grid.draw(venn.stocks.notrim)
stocks.notrim <- ps_venn(ps.stocks.notrim,group="Microbe_treatment",quantities=TRUE,main="ASVs per microbial stock",labels=c("LAB","ENV","MOS"),fills = list(fill = c("#7D0112", "#84D1B5","#C6A947"), alpha = 0.5),plot=F)
stocks.notrim[["E. coli"]]
## [1] "ASV0002" "ASV0030"
##2 is like in everything in the real samples & very little in the stocks, plus looks like it came from lab water :(
envonly.untrim <- stocks.notrim[["Env. microbes"]]
mosonly.untrim <- stocks.notrim[["Mosquito microbes"]]
##saving to add info to taxa file, which I will do manually in Excel
write.table(mosonly.untrim,"mosonly.txt", sep="\t",col.names = FALSE, row.names = FALSE,quote=F)
write.table(envonly.untrim,"envonly.txt", sep="\t",col.names = FALSE, row.names = FALSE,quote=F)
#envmos.untrim <- stocks.notrim
plot_bar(ps.stocks.notrim)
##others to check out:
# > stocks.notrim[["E. coli__Env. microbes__Mosquito microbes"]]
# [1] "ASV0003" "ASV0007"
# > stocks.notrim[["E. coli__Env. microbes"]]
# [1] "ASV0005" "ASV0008" "ASV0009" "ASV0132"
# > stocks.notrim[["E. coli__Mosquito microbes"]]
# [1] "ASV0001" = definitely from E. coli
# > stocks.notrim[["Env. microbes__Mosquito microbes"]]
# [1] "ASV0006" "ASV0053" "ASV0136" "ASV0149" "ASV0525" "ASV0989" "ASV1146"
I looked at the ones that were trimmed <0.1% abundance before, but there are a ton that are unclear so checking less stringently which ones might be in MOS, ENV, or both
otu.trim <- data.frame(ps.clean.trim@otu_table)
otu.notrim <- data.frame(ps.clean.notrim@otu_table)
##sample that aren't matching up between them:
#row.names(otu.trim) %in% row.names(otu.notrim)
what <- otu.trim[!row.names(otu.trim) %in% row.names(otu.notrim),]
what2 <- otu.notrim[!row.names(otu.notrim) %in% row.names(otu.trim),]
rowSums(what)
## N2 N6 PCR-NEG-2
## 22 264 655
rowSums(what2)
## N5 WB39
## 7 42
##which ones are in the hatching flasks - trimmed data
# - Hatching flask water
# - Hatching flask L1s
# - Lab water
ps.base1 <- subset_samples(ps.clean.trim,Mesocosm_treatment=="Hatch_flask" | Mesocosm_treatment=="Lab_water")
ps.base <- prune_taxa(taxa_sums(ps.base1)!=0,ps.base1)
ps.base
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 6 taxa and 3 samples ]
## sample_data() Sample Data: [ 3 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 6 taxa by 10 taxonomic ranks ]
plot_bar(ps.base,fill="id",x="Longer_name")+
facet_wrap(~Genus,scales="free")
ps.base@otu_table
## OTU Table: [6 taxa and 3 samples]
## taxa are columns
## ASV0002 ASV0008 ASV0018 ASV0030 ASV0227 ASV0274
## LH1 51407 79 162 3224 1764 1994
## WB1 47662 0 806 0 0 0
## WB2 48 0 0 0 0 0
##4 taxa of note to take with a grain of salt:
##"ASV0002" "ASV0008" "ASV0018" "ASV0030"
#Wolbachia: "ASV0227" "ASV0274"
#ASV2 = extremely convincing information that it was in the lab water - Sphingomonas
#the hatching flask water looked very clean though... confusing
#ASV0030 = in the hatching flask larvae???
#ASV0008 = in the hatching flask larvae - but just 80 counts total... - Novosphingobium
#ASV18 = 800+ counts in the lab water
##ASV30 = E.coli
ps.trim.asv30.1 <- subset_taxa(ps.clean.trim, id=="ASV0030")
ps.trim.asv30 <- prune_taxa(taxa_sums(ps.trim.asv30.1)!=0,ps.trim.asv30.1)
plot_bar(ps.trim.asv30,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##ASV2 = sphingomonas - in the lab water?
ps.trim.asv2.1 <- subset_taxa(ps.clean.trim, id=="ASV0002")
ps.trim.asv2 <- prune_taxa(taxa_sums(ps.trim.asv2.1)!=0,ps.trim.asv2.1)
plot_bar(ps.trim.asv2,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##asv8 = sphingomonas - in the lab water?
ps.trim.asv8.1 <- subset_taxa(ps.clean.trim, id=="ASV0008")
ps.trim.asv8 <- prune_taxa(taxa_sums(ps.trim.asv8.1)!=0,ps.trim.asv8.1)
plot_bar(ps.trim.asv8,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##asv18 = sphingomonas
ps.trim.asv18.1 <- subset_taxa(ps.clean.trim, id=="ASV0018")
ps.trim.asv18 <- prune_taxa(taxa_sums(ps.trim.asv18.1)!=0,ps.trim.asv18.1)
plot_bar(ps.trim.asv18,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##all taxa that are in the base controls
ps.clean.basetax <- subset_taxa(ps.clean.trim, taxa_names(ps.clean.trim) %in% taxa_names(ps.base))
plot_bar(ps.clean.basetax,fill="id")+
facet_wrap(Genus~Sample_type,scales="free")
ps.clean.wolb <- subset_taxa(ps.clean.trim,Genus=="Wolbachia")
plot_bar(ps.clean.wolb)
ps.mesocontrols1 <- subset_samples(ps.clean.trim,Microbe_treatment %in% c("None_food","None_larvae"))
ps.mesocontrols1
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 514 taxa and 8 samples ]
## sample_data() Sample Data: [ 8 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 514 taxa by 10 taxonomic ranks ]
ps.mesocontrols <- prune_taxa(taxa_sums(ps.mesocontrols1)!=0,ps.mesocontrols1)
ps.mesocontrols
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 11 taxa and 8 samples ]
## sample_data() Sample Data: [ 8 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 11 taxa by 10 taxonomic ranks ]
plot_bar(ps.mesocontrols,fill="Genus", x="Longer_name")+
facet_wrap(~id,scales="free")
##asv49 = Amnibacterium
ps.trim.asv49.1 <- subset_taxa(ps.clean.trim, id=="ASV0049")
ps.trim.asv49 <- prune_taxa(taxa_sums(ps.trim.asv49.1)!=0,ps.trim.asv49.1)
plot_bar(ps.trim.asv49,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##asv68 = Amnibacterium
ps.trim.asv68.1 <- subset_taxa(ps.clean.trim, id=="ASV0068")
ps.trim.asv68 <- prune_taxa(taxa_sums(ps.trim.asv68.1)!=0,ps.trim.asv68.1)
plot_bar(ps.trim.asv68,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##asv97 = methylo
ps.trim.asv97.1 <- subset_taxa(ps.clean.trim, id=="ASV0097")
ps.trim.asv97 <- prune_taxa(taxa_sums(ps.trim.asv97.1)!=0,ps.trim.asv97.1)
plot_bar(ps.trim.asv97,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##asv131 - spirosoma
ps.trim.asv131.1 <- subset_taxa(ps.clean.notrim, id=="ASV0131")
ps.trim.asv131 <- prune_taxa(taxa_sums(ps.trim.asv131.1)!=0,ps.trim.asv131.1)
plot_bar(ps.trim.asv131,fill="id")+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
###same stuff as above but relative abundance
ps.mesocontrols.rel <- transform_sample_counts(ps.mesocontrols, function(x) x / sum(x))
plot_bar(ps.mesocontrols.rel,fill="id",x="Longer_name")+
facet_wrap(~Genus,scales="free")
sample_sums(ps.mesocontrols)
## LB1 LL1 WB37 WB38 WB4 WB6 WL1 WL3
## 49680 26906 45732 75147 76028 57996 80507 137
##how many shared with real samples
ps.clean.trim
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 514 taxa and 169 samples ]
## sample_data() Sample Data: [ 169 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 514 taxa by 10 taxonomic ranks ]
ps.noctrl <- subset_samples(ps.clean.trim,!Mesocosm_type %in% c("Negative","Positive"))
ps.noctrl
## phyloseq-class experiment-level object
## otu_table() OTU Table: [ 514 taxa and 161 samples ]
## sample_data() Sample Data: [ 161 samples by 24 sample variables ]
## tax_table() Taxonomy Table: [ 514 taxa by 10 taxonomic ranks ]
table(ps.noctrl@sam_data$Mesocosm_type)
##
## Additional control Experiment Hatching flask Lab water
## 25 130 2 1
## Microbe stock
## 3
ps_venn(ps.noctrl,group="Mesocosm_type",quantities=TRUE)
ps_venn(ps.noctrl,group="Mesocosm_type",quantities=TRUE,plot=F)
## $`Additional control`
## [1] "ASV0049" "ASV0068" "ASV0097" "ASV0108" "ASV0131" "ASV0224" "ASV0294"
## [8] "ASV0321" "ASV0341" "ASV0369" "ASV0400" "ASV0430" "ASV0441" "ASV0447"
## [15] "ASV0553" "ASV0564" "ASV0565" "ASV0588" "ASV0610" "ASV0621" "ASV0656"
## [22] "ASV0673" "ASV0683" "ASV0958" "ASV1569"
##
## $Experiment
## [1] "ASV0014" "ASV0019" "ASV0028" "ASV0032" "ASV0050" "ASV0052" "ASV0055"
## [8] "ASV0070" "ASV0075" "ASV0086" "ASV0087" "ASV0090" "ASV0096" "ASV0113"
## [15] "ASV0120" "ASV0129" "ASV0140" "ASV0142" "ASV0144" "ASV0147" "ASV0148"
## [22] "ASV0164" "ASV0166" "ASV0171" "ASV0177" "ASV0185" "ASV0186" "ASV0190"
## [29] "ASV0193" "ASV0196" "ASV0197" "ASV0198" "ASV0204" "ASV0210" "ASV0212"
## [36] "ASV0213" "ASV0214" "ASV0215" "ASV0220" "ASV0221" "ASV0222" "ASV0223"
## [43] "ASV0228" "ASV0232" "ASV0233" "ASV0235" "ASV0237" "ASV0241" "ASV0244"
## [50] "ASV0246" "ASV0247" "ASV0252" "ASV0253" "ASV0256" "ASV0261" "ASV0263"
## [57] "ASV0264" "ASV0265" "ASV0268" "ASV0270" "ASV0272" "ASV0275" "ASV0276"
## [64] "ASV0280" "ASV0284" "ASV0287" "ASV0288" "ASV0289" "ASV0291" "ASV0296"
## [71] "ASV0301" "ASV0302" "ASV0304" "ASV0306" "ASV0308" "ASV0309" "ASV0313"
## [78] "ASV0314" "ASV0315" "ASV0316" "ASV0318" "ASV0319" "ASV0320" "ASV0325"
## [85] "ASV0327" "ASV0331" "ASV0332" "ASV0336" "ASV0339" "ASV0342" "ASV0345"
## [92] "ASV0346" "ASV0347" "ASV0352" "ASV0353" "ASV0354" "ASV0359" "ASV0360"
## [99] "ASV0361" "ASV0362" "ASV0363" "ASV0365" "ASV0366" "ASV0373" "ASV0374"
## [106] "ASV0376" "ASV0378" "ASV0379" "ASV0387" "ASV0389" "ASV0391" "ASV0392"
## [113] "ASV0393" "ASV0394" "ASV0395" "ASV0396" "ASV0397" "ASV0399" "ASV0402"
## [120] "ASV0403" "ASV0405" "ASV0406" "ASV0409" "ASV0411" "ASV0415" "ASV0416"
## [127] "ASV0417" "ASV0420" "ASV0421" "ASV0438" "ASV0440" "ASV0442" "ASV0446"
## [134] "ASV0451" "ASV0452" "ASV0453" "ASV0454" "ASV0458" "ASV0459" "ASV0460"
## [141] "ASV0461" "ASV0467" "ASV0469" "ASV0471" "ASV0472" "ASV0473" "ASV0478"
## [148] "ASV0480" "ASV0481" "ASV0482" "ASV0489" "ASV0493" "ASV0494" "ASV0496"
## [155] "ASV0498" "ASV0500" "ASV0501" "ASV0503" "ASV0504" "ASV0505" "ASV0506"
## [162] "ASV0509" "ASV0510" "ASV0512" "ASV0513" "ASV0514" "ASV0515" "ASV0524"
## [169] "ASV0526" "ASV0531" "ASV0532" "ASV0533" "ASV0535" "ASV0539" "ASV0544"
## [176] "ASV0548" "ASV0549" "ASV0552" "ASV0555" "ASV0557" "ASV0558" "ASV0559"
## [183] "ASV0561" "ASV0562" "ASV0567" "ASV0568" "ASV0570" "ASV0571" "ASV0572"
## [190] "ASV0573" "ASV0581" "ASV0582" "ASV0585" "ASV0586" "ASV0591" "ASV0595"
## [197] "ASV0598" "ASV0603" "ASV0608" "ASV0612" "ASV0615" "ASV0626" "ASV0631"
## [204] "ASV0642" "ASV0649" "ASV0650" "ASV0677" "ASV0678" "ASV0681" "ASV0682"
## [211] "ASV0687" "ASV0701" "ASV0706" "ASV0717" "ASV0722" "ASV0734" "ASV0735"
## [218] "ASV0746" "ASV0761" "ASV0763" "ASV0781" "ASV0789" "ASV0792" "ASV0794"
## [225] "ASV0802" "ASV0805" "ASV0814" "ASV0846" "ASV0971" "ASV1191" "ASV1216"
##
## $`Hatching flask`
## [1] "ASV0274"
##
## $`Microbe stock`
## [1] "ASV0239" "ASV0322" "ASV0398" "ASV0412" "ASV0433" "ASV0436" "ASV0466"
## [8] "ASV0474" "ASV0527" "ASV0545" "ASV0578" "ASV0580" "ASV0583" "ASV0613"
## [15] "ASV0634" "ASV0665" "ASV0672" "ASV0676" "ASV0699" "ASV0752" "ASV0768"
## [22] "ASV0786" "ASV0868" "ASV0870" "ASV0938" "ASV0989" "ASV1146"
##
## $`Additional control__Experiment__Hatching flask__Lab water`
## [1] "ASV0002" "ASV0018"
##
## $`Additional control__Experiment__Hatching flask__Microbe stock`
## [1] "ASV0008" "ASV0030"
##
## $`Additional control__Experiment__Hatching flask`
## [1] "ASV0227"
##
## $`Additional control__Experiment__Microbe stock`
## [1] "ASV0001" "ASV0003" "ASV0004" "ASV0006" "ASV0007" "ASV0009" "ASV0010"
## [8] "ASV0012" "ASV0016" "ASV0017" "ASV0022" "ASV0025" "ASV0027" "ASV0051"
## [15] "ASV0053" "ASV0059" "ASV0063" "ASV0066" "ASV0069" "ASV0072" "ASV0093"
## [22] "ASV0095" "ASV0102" "ASV0105" "ASV0111" "ASV0116" "ASV0117" "ASV0123"
## [29] "ASV0136" "ASV0145" "ASV0146" "ASV0155" "ASV0167" "ASV0179" "ASV0180"
## [36] "ASV0238"
##
## $`Additional control__Experiment`
## [1] "ASV0005" "ASV0011" "ASV0013" "ASV0015" "ASV0020" "ASV0021" "ASV0023"
## [8] "ASV0024" "ASV0029" "ASV0033" "ASV0036" "ASV0037" "ASV0038" "ASV0039"
## [15] "ASV0040" "ASV0041" "ASV0042" "ASV0043" "ASV0044" "ASV0047" "ASV0054"
## [22] "ASV0056" "ASV0057" "ASV0060" "ASV0061" "ASV0062" "ASV0065" "ASV0073"
## [29] "ASV0076" "ASV0077" "ASV0078" "ASV0079" "ASV0080" "ASV0081" "ASV0082"
## [36] "ASV0083" "ASV0084" "ASV0085" "ASV0088" "ASV0089" "ASV0091" "ASV0094"
## [43] "ASV0098" "ASV0099" "ASV0101" "ASV0103" "ASV0106" "ASV0109" "ASV0112"
## [50] "ASV0115" "ASV0118" "ASV0119" "ASV0121" "ASV0124" "ASV0125" "ASV0126"
## [57] "ASV0127" "ASV0128" "ASV0130" "ASV0132" "ASV0133" "ASV0134" "ASV0137"
## [64] "ASV0138" "ASV0139" "ASV0143" "ASV0150" "ASV0152" "ASV0154" "ASV0157"
## [71] "ASV0158" "ASV0160" "ASV0161" "ASV0168" "ASV0170" "ASV0172" "ASV0173"
## [78] "ASV0176" "ASV0178" "ASV0181" "ASV0182" "ASV0183" "ASV0184" "ASV0187"
## [85] "ASV0188" "ASV0189" "ASV0191" "ASV0192" "ASV0199" "ASV0200" "ASV0202"
## [92] "ASV0203" "ASV0208" "ASV0209" "ASV0211" "ASV0217" "ASV0219" "ASV0225"
## [99] "ASV0230" "ASV0231" "ASV0236" "ASV0243" "ASV0248" "ASV0249" "ASV0251"
## [106] "ASV0255" "ASV0257" "ASV0258" "ASV0260" "ASV0262" "ASV0266" "ASV0271"
## [113] "ASV0279" "ASV0283" "ASV0285" "ASV0297" "ASV0298" "ASV0299" "ASV0307"
## [120] "ASV0310" "ASV0329" "ASV0335" "ASV0337" "ASV0340" "ASV0343" "ASV0349"
## [127] "ASV0356" "ASV0357" "ASV0364" "ASV0381" "ASV0388" "ASV0390" "ASV0401"
## [134] "ASV0407" "ASV0410" "ASV0425" "ASV0429" "ASV0437" "ASV0443" "ASV0445"
## [141] "ASV0450" "ASV0462" "ASV0476" "ASV0488" "ASV0495" "ASV0517"
##
## $`Additional control__Microbe stock`
## [1] "ASV0286" "ASV0606"
##
## $`Experiment__Microbe stock`
## [1] "ASV0045" "ASV0058" "ASV0100" "ASV0149" "ASV0162" "ASV0175" "ASV0206"
## [8] "ASV0218" "ASV0277" "ASV0278" "ASV0281" "ASV0282" "ASV0311" "ASV0312"
## [15] "ASV0324" "ASV0333" "ASV0338" "ASV0344" "ASV0355" "ASV0368" "ASV0383"
## [22] "ASV0386" "ASV0432" "ASV0521" "ASV0525" "ASV0528" "ASV0534" "ASV0648"
## [29] "ASV0685"
The following doesn’t work anymore now that I assigned everything…
##see if we accounted for all the unclear ones overlapping with known sources:
ps.noctrl.unc <- subset_taxa(ps.noctrl,likely_source_untrimmed=="unclear")
ps.noctrl.unc
table(ps.noctrl.unc@sam_data$Mesocosm_type)
ps_venn(ps.noctrl.unc,group="Mesocosm_type",quantities=TRUE)
table(ps.noctrl.unc@sam_data$Microbe_treatment)
ps.noctrl.unc.big3 <- subset_samples(ps.noctrl.unc,Microbe_treatment %in% c("ECO","EMO","MMO") & Exp_day!=20)
#table(ps.noctrl.unc.big3@sam_data$Exp_day)
ps_venn(ps.noctrl.unc.big3,group="Microbe_treatment",quantities=TRUE)
ps_venn(ps.noctrl.unc.big3,group="Microbe_treatment",quantities=TRUE,plot=F)
##checking out just eco group
ps.unc.eco1 <- subset_samples(ps.noctrl.unc,Microbe_treatment=="ECO")
ps.unc.eco <- prune_taxa(taxa_sums(ps.unc.eco1)!=0,ps.unc.eco1)
ps_venn(ps.unc.eco,group="Mesocosm_treatment",quantities=T)
plot_bar(ps.unc.eco,fill="id",x="Longer_name")+
facet_wrap(~Genus,scales="free")
##Massilia looks sus
ps.asv420 <- subset_taxa(ps.clean.trim,id=="ASV0420")
plot_bar(ps.asv420)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##Methylo 28 looks sus
ps.asv28 <- subset_taxa(ps.clean.trim,id=="ASV0028")
plot_bar(ps.asv28)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##Methylo 75 looks sus
ps.asv75 <- subset_taxa(ps.clean.trim,id=="ASV0075")
plot_bar(ps.asv75)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##checking out just emo & mmo group
ps.unc.envmos1 <- subset_samples(ps.noctrl.unc,Microbe_treatment %in% c("EMO","MMO") & Exp_day!=20 & Mesocosm_type=="Experiment")
ps.unc.envmos1
ps.unc.envmos <- prune_taxa(taxa_sums(ps.unc.envmos1)!=0,ps.unc.envmos1)
ps_venn(ps.unc.envmos,group="Microbe_treatment",quantities=T)
table(ps.unc.envmos@sam_data$Mesocosm_treatment)
ps_venn(ps.unc.envmos,group="Microbe_treatment",quantities=T)
venn.unc.envmos <- ps_venn(ps.unc.envmos,group="Microbe_treatment",quantities=T,plot=F)
ps.unc.envmos.8<- subset_taxa(ps.unc.envmos, id %in% c("ASV0037","ASV0057","ASV0060","ASV0065","ASV0125","ASV0130","ASV0176","ASV0181"))
plot_bar(ps.unc.envmos.8,fill="id",x="Longer_name")+
facet_wrap(~Microbe_treatment,scales="free")
ps.asv37 <- subset_taxa(ps.clean.trim,id=="ASV0037")
plot_bar(ps.asv37)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
ps.asv57 <- subset_taxa(ps.clean.trim,id=="ASV0057")
plot_bar(ps.asv57)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
ps.asv60 <- subset_taxa(ps.clean.trim,id=="ASV0060")
plot_bar(ps.asv60)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
ps.asv65 <- subset_taxa(ps.clean.trim,id=="ASV0065")
plot_bar(ps.asv65)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
ps.asv125 <- subset_taxa(ps.clean.trim,id=="ASV0125")
plot_bar(ps.asv125)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
ps.asv176 <- subset_taxa(ps.clean.trim,id=="ASV0176")
plot_bar(ps.asv176)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
ps.asv181 <- subset_taxa(ps.clean.trim,id=="ASV0181")
plot_bar(ps.asv181)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
##based on negative controls:
ps.asv7 <- subset_taxa(ps.clean.trim,id=="ASV0007")
plot_bar(ps.asv7)+
facet_wrap(Sample_type~Microbe_treatment,scales="free")
Will do manually in excel after… Also… some of the output above won’t look the same after I change the spreadsheets… oh well
envonly.unc <- venn.unc.envmos[["EMO"]]
mosonly.unc <- venn.unc.envmos[["MMO"]]
##saving to add info to taxa file, which I will do manually in Excel
#write.table(mosonly.unc,"mosonly_more.txt", sep="\t",col.names = FALSE, row.names = FALSE,quote=F)
#write.table(envonly.unc,"envonly_more.txt", sep="\t",col.names = FALSE, row.names = FALSE,quote=F)